import os

from library_test.mock_manage.mock_model.mock_ansible_module import AnsibleModule
from library_test.test_install_cann.test_install_cann import TestInstallCann


class TestInstallToolboxCase1(TestInstallCann):

    @classmethod
    def get_testcase_path(cls):
        return os.path.join(cls.TESTCASE_DIR, "ubuntu_22.04_arch64_install_toolbox_success.yml")

    def test(self):
        with self.assertRaises(AnsibleModule.ExitJson) as context:
            self.run_test()
        res = self.parse_context_exception(context)
        self.assertIn("success", res.get("stdout"))
